* {
  box-sizing: border-box;
}

body {
  font-family: 'Microsoft YaHei', Arial, sans-serif;
  width: 320px;
  margin: 0;
  padding: 0;
  background-color: #f5f5f5;
  overflow-x: hidden; /* 关闭水平滚动 */
}

.container {
  padding: 15px;
  max-width: 100%;
  width: 100%;
  overflow-x: hidden;
}

h1 {
  color: #4285f4;
  font-size: 20px;
  margin: 0;
}

h2 {
  color: #333;
  font-size: 16px;
  margin-top: 15px;
}

.actions {
  display: flex;
  justify-content: space-between;
  margin-bottom: 15px;
}

.btn {
  padding: 8px 12px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s;
}

.primary {
  background-color: #4285f4;
  color: white;
}


.primary:hover {
  background-color: #3367d6;
}

/* .secondary {
  background-color: #f1f1f1;
  color: #333;
}

.secondary:hover {
  background-color: #e0e0e0;
} */

.info {
  background-color: #34a853;
  color: white;
}

.info:hover {
  background-color: #2d9249;
}

.status {
  margin: 10px 0;
  padding: 8px;
  border-radius: 4px;
  text-align: center;
  display: none;
}

.success {
  display: block;
  background-color: #d4edda;
  color: #155724;
}

.error {
  display: block;
  background-color: #f8d7da;
  color: #721c24;
}

.bookmarks-list {
  margin-top: 15px;
  max-height: 400px;
  overflow-y: auto;
}

/* 分类样式 */
.category-item {
  margin-bottom: 8px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}

.category-header {
  display: flex;
  align-items: center;
  padding: 10px;
  background-color: #f1f3f4;
  cursor: pointer;
  transition: background-color 0.2s;
}

.category-header:hover {
  background-color: #e8eaed;
}

.category-title {
  font-weight: bold;
  color: #202124;
  margin-left: 8px;
  flex-grow: 1;
}

.toggle-icon {
  color: #5f6368;
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.bookmarks-sublist {
  background-color: #fff;
  border-top: 1px solid #e0e0e0;
  padding: 0;
}

.bookmarks-sublist .bookmark-item {
  padding: 8px 10px;
  border-bottom: 1px solid #f1f1f1;
}

.bookmarks-sublist .bookmark-item:last-child {
  border-bottom: none;
}

.loading-message, .empty-message, .error-message {
  padding: 10px;
  text-align: center;
  color: #5f6368;
  font-style: italic;
}

.error-message {
  color: #d93025;
}

ul {
  list-style-type: none;
  padding: 0;
  margin: 0;
}

li {
  padding: 8px 0;
  border-bottom: 1px solid #e0e0e0;
}

.bookmark-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bookmark-title {
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 10px;
}

.bookmark-link {
  color: #1a73e8;
  text-decoration: none;
}

.bookmark-link:hover {
  text-decoration: underline;
}

.delete-btn {
  background-color: transparent;
  color: #d93025;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 0 5px;
}

.delete-btn:hover {
  color: #a50e0e;
}

.metadata-section {
  margin: 15px 0;
  padding: 10px;
  background-color: #e8f0fe;
  border-radius: 4px;
  border-left: 4px solid #4285f4;
}

.metadata-content {
  font-size: 14px;
}

.metadata-item {
  margin: 8px 0;
}

.metadata-label {
  font-weight: bold;
  color: #333;
}

.metadata-value {
  color: #555;
  word-break: break-word;
}

.metadata-favicon {
  width: 16px;
  height: 16px;
  margin-right: 5px;
  vertical-align: middle;
}

.loading {
  text-align: center;
  padding: 10px;
}

.loading:after {
  content: "...";
  animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: ".";
  }
  40% {
    content: "..";
  }
  60%, 100% {
    content: "...";
  }
}

/* 登录界面样式 */
.login-section {
  text-align: center;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
}

.login-section h2 {
  margin-top: 0;
  color: #333;
  font-size: 18px;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 15px;
}

.login-input {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.login-input:focus {
  outline: none;
  border-color: #4285f4;
}

/* 头部样式 */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.header h1 {
  flex: 1;
  font-size: 20px;
  color: #202124;
}

.logo {
  width: 26px;
  height: 26px;
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.logo:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 2px 4px rgba(66, 133, 244, 0.35));
}

/* 主界面样式 */
.main-section {
  display: block;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background-color: #e8f0fe;
  border-radius: 4px;
  border-left: 4px solid #4285f4;
}

.user-info span {
  font-weight: bold;
  color: #333;
}

.btn.logout,.btn.bookmark {
  background-color: #d93025;
  color: white;
  padding: 5px 10px;
  font-size: 12px;
}
.btn.bookmark{
  background-color: #4285f4;
}

.btn.logout:hover {
  background-color: #a50e0e;
}

/* 拖拽相关样式 */
.bookmark-item[draggable="true"] {
  cursor: grab;
}

.bookmark-item.dragging {
  opacity: 0.5;
  transform: rotate(2deg);
  cursor: grabbing;
}

.category-header.drag-target {
  background-color: #e3f2fd;
  border: 2px dashed #2196f3;
  animation: pulse 1s infinite;
}

.category-header.drag-over {
  background-color: #c8e6c9;
  border: 2px solid #4caf50;
  transform: scale(1.02);
}

@keyframes pulse {
  0% {
    border-color: #2196f3;
  }
  50% {
    border-color: #64b5f6;
  }
  100% {
    border-color: #2196f3;
  }
}

/* 拖拽提示 */
.drag-hint {
  position: absolute;
  background-color: #333;
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.9;
}

/* 书签项拖拽时的额外样式 */
.bookmark-item:hover {
  background-color: #f5f5f5;
}

.bookmark-item.dragging:hover {
  background-color: transparent;
}

/* 分类标题在拖拽时的过渡效果 */
.category-header {
  transition: all 0.2s ease;
}

/* 标签页样式 */
.tabs {
  display: flex;
  border-bottom: 1px solid #ddd;
  margin-bottom: 15px;
}

.tab-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  background-color: transparent;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: 14px;
  color: #666;
  transition: all 0.3s ease;
}

.tab-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.tab-btn.active {
  color: #4285f4;
  border-bottom-color: #4285f4;
  font-weight: bold;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* 最近关闭标签页样式 */
.closed-tabs-list {
  max-height: 400px;
  overflow-y: auto;
  overflow-x: hidden;
  width: 100%;
}

.closed-tab-item {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  margin-bottom: 5px;
  background-color: white;
  border-radius: 4px;
  border-left: 3px solid #4285f4;
  cursor: pointer;
  transition: all 0.2s ease;
  width:  calc(100% - 10px);
  max-width: 100%;
}

.closed-tab-item:hover {
  background-color: #f0f7ff;
  transform: translateX(2px);
}

.closed-tab-content {
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
}

.closed-tab-title {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.closed-tab-url {
  font-size: 12px;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.closed-tab-time {
  font-size: 12px;
  color: #999;
  margin-left: 8px;
}

.empty-message {
  text-align: center;
  color: #999;
  font-style: italic;
  padding: 20px;
}